package com.patrrr.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.telephony.gsm.GsmCellLocation;
/**
 * 编辑/读取配置信息
 * @author starry
 *
 */
public class Configuration {
	private Context mContext;
	private SharedPreferences sharedPreferences;
	private final String config="config";
	
	public static final String FONTSIZE="fontSize";
	public static final String COLOR="color";
	
	public Configuration(Context context) {
		super();
		// TODO Auto-generated constructor stub
		mContext=context;
		sharedPreferences=mContext.getSharedPreferences(config, Context.MODE_PRIVATE);
	}

	public void saveString(String name,String value){
		SharedPreferences.Editor editor=sharedPreferences.edit();
		editor.putString(name, value);
		editor.commit();
	}
	public void saveInt(String name,int value){
		SharedPreferences.Editor editor=sharedPreferences.edit();
		editor.putInt(name, value);
		editor.commit();
	}
	
	public String getString(String name,String defaultValue){
		return sharedPreferences.getString(name, defaultValue);
	}
	public int getInt(String name,int defaultValue){
		return sharedPreferences.getInt(name, defaultValue);
	}

}
